# Contributor: Keith Toh <ktprograms@gmail.com>
# Maintainer: Sebastian Hudak <sebastian@sebsite.pw>
pkgname=ace-of-penguins
pkgver=1.4
pkgrel=2
pkgdesc="Collection of one-player games for X"
url="https://www.delorie.com/store/ace/"
arch="all"
license="GPL-2.0-or-later"
makedepends="libpng-dev libx11-dev libxpm-dev zlib-dev"
subpackages="$pkgname-doc"
# .desktop files were taken from ace-of-penguins AUR files, with slight
# modifications.
# https://aur.archlinux.org/packages/ace-of-penguins
source="https://www.delorie.com/store/ace/ace-$pkgver.tar.gz
	ace.patch
	fix-font.patch
	canfield.desktop
	freecell.desktop
	golf.desktop
	mastermind.desktop
	merlin.desktop
	minesweeper.desktop
	pegged.desktop
	penguins.desktop
	solitaire.desktop
	spider.desktop
	taipei-editor.desktop
	taipei.desktop
	thornq.desktop
	"
builddir="$srcdir/ace-$pkgver"

prepare() {
	default_prepare

	update_config_sub
	update_config_guess
}

build() {
	./configure --prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/lib/libcards.a
	install -Dm644 docs/*.* -t "$pkgdir"/usr/share/doc/ace-of-penguins/
	install -Dm644 "$srcdir"/*.desktop -t "$pkgdir"/usr/share/applications/
}

sha512sums="
cd382db95dc17d75a76809c7f1e096e14f5863c1166aa5db7f93204ce949a9ed21979212946b9d3a09667f4a93b30f4cc44a220940f9b5dd8996f28ecb4a6dcc  ace-1.4.tar.gz
6846662deda4c21a89ecaf55afe1580f82f67122f236618a94dcd584cd3a5a76d0429c9bd4ac808e29d04ae78ab9cf9417e274585f87af46a0a769af4917f509  ace.patch
b3cd34677326d4b9e47875698aa1bca6985231e1f0e14dc9acdb815c443f767f1199dbd8dd0c72a3aaa2eba62e35c3473a60acaab7c606d848c6cbdb854d3487  fix-font.patch
4ba6813cb57d2ed41ee8a582b4cc3026a9f69d4c78ee5a012cdcb3284efee0b3efb04917ad2bd9fb4846b7007cce4bfef7e5e9bd8e91c229b4ed31d077f4f10b  canfield.desktop
3f0b3a55af0df885d23fcd73764e0548b7f7d0e25eb881ee1e24d108dd51a234e4140d37a6c616bc39dc2eb70aeeb0f370a1c0ef0ec3314ffb4a07ab89e0b005  freecell.desktop
d76332b739d938ed29ad30f41baaddff6efa70e674aa7354f60b342f828d470212bebacb2a02f6921b8740a616b97b97002455eb153555d7350ffab3ea7b670a  golf.desktop
24adc08aa52625c25d6315160f45ce3ded0b733238c09aff1764c39f5e95229bff7da70757318048c703faf120a273127bc965ae462bb0b47460f5cf1a4607da  mastermind.desktop
d235d731fc8d3e43537a0e16d61c62f032cb78ce341279af36c4bdd7e7f7101d12ffd04d767ecd51cc6b6e993b46694b09abebb45631cd16a175013f65dc6329  merlin.desktop
8015901cd23d17b19daa62cc2f2f9d377b9af37d5099b651e9ff0f07af07262b65ac81cb84a6d672f429a2bf0e69ab11f7376e90fcafe11dd977b58901152cf4  minesweeper.desktop
70f86cb3919c6f5627fcd86fef5812bdeb5370cc0eab47530912ef4c1a300865b204b5091ce1fc0bd51b857996a9fff795c1847c8d48daa8f80ddabd6a7c5521  pegged.desktop
a224aed5a4ffb26f84d892285559767da203542e8610d06a39562bb491458ffacba834191f7970cb5d868f302bfd242a3db8dcb4659c368081cf81e45179bd92  penguins.desktop
d51a8657471729a7fabd85a88aa90b6cb2598a078c9880bb945ada923eaa9340ba82a22d2f8a477fd84201a9282d1667c24d043989d8fd24a3d04a75c89e3ef2  solitaire.desktop
8a9fa45b275acccb78a52db218d424abc71af2f3aa1ae5f8a197a5685a48ed08a90b57225f563ae430211ebadb5f63217650fc2b5cff5a7b4e6abdb9757f6202  spider.desktop
8c5c81bd806b3a453c2480bf6a3cc83f532c99c9ee439a906ee1eccaf908380d83441ad538179ca9c9fa9f3fd6d5c0de1a97a09794ec5df470e6a1f8baf3c181  taipei-editor.desktop
7930c8af3def8f0d1ff9f8e0a2fcdc8d953eeb2699c4bf5dde794e862ddf616a9d86b202f1e7b9a8507b7e898721a62b3edafa59d9c27d0d4ce73fc89fcbb0f3  taipei.desktop
b8a84c7aa1fca593a604e936e9500939a92a3278252ebf86ad3d1b168ead4ec9e6319f37c81e74d8d577b4bae647ce2238dafb57550ca8d7fea66fc5d5aa5c7d  thornq.desktop
"
